class Cinema < ActiveRecord::Base
  validates_presence_of :name, :add, :employees, :movie_house_quantity, :phone, :description
  validates_numericality_of :employees, :movie_house_quantity
  
  protected
  def validate
    errors.add(:employees, "should be at least 1") if employees.nil? || employees < 1
    errors.add(:movie_house_quantity, "should be at least 1") if movie_house_quantity.nil? || movie_house_quantity < 1
  end
end
